<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8" />
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimal-ui">
        <title><?php echo (L("_web_title_")); ?></title>
        <meta content="Admin Dashboard" name="description" />
        <meta content="Themesdesign" name="author" />
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />       
        <!-- App Icons -->     
        <link rel="shortcut icon" type="image/x-icon" href="/xnqb/Public/Home/images/favicon.ico">
        <!--Morris Chart CSS -->
        <link rel="stylesheet" href="/xnqb/Public/Home/css/morris.css">

        <!-- App css -->
        <link href="/xnqb/Public/Home/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
        <!--  -->
        <link href="/xnqb/Public/Home/css/icons.css" rel="stylesheet" type="text/css" />
        <link href="/xnqb/Public/Home/css/style.css" rel="stylesheet" type="text/css" />
        <link href="/xnqb/Public/Home/flag-css/css/flag-icon.min.css" rel="stylesheet" type="text/css" />
        <style type="text/css">
            #topnav .navbar-custom {
                linear-gradient(to right, #043E73,#287BC7);
                box-shadow: 0 1px 1px rgba(0,0,0,.1);
                padding-left: 0;
            }

            .header-item h5 {
                color: hsl(51, 100%, 57%);
                font-size: 14px;
            }
            .my-container{
            	width:60%;
            }
            
            @media (max-width:991px) {

				.my-container {
					width:100%;
				}
			}
        </style>
    </head>


    <body>

        <!-- Begin page -->
        <div class="accountbg"></div>
        <div class="wrapper-page">

            <div class="card">
                <div class="card-body">

                  

                    <h4 class="text-muted text-center font-18"><b><?php echo (L("_authentication_")); ?></b></h4>

                    <div class="p-3">
                        <form id="login_form" class="form-horizontal m-t-20" method="post" action="" >
                             <div class="form-group row">
                               <span style="padding-left:15px;">系统已经将安全码发至您的邮箱！</span>
                             </div>
                            <div class="form-group row">
                                <div class="col-12">
                                    <input class="form-control" value="<?php echo ($email); ?>" disabled="disabled" name="username" type="text">
                                </div>
                            </div>

                            <div class="form-group row">
                                    <label for="example-text-input" class="col-sm-4 col-form-label">邮箱安全码</label>
                                    <div class="col-sm-8">
                                        <input class="form-control" id="safe_code" placeholder="<?php echo (L("_reg_input_placeholder_")); ?>邮箱安全码" name="safe_code" type="text" required="" 
                                                    data-parsley-minlength="4" 
                                                    data-parsley-minlength-message="<?php echo (L("_reg_verification_code_minlength_")); ?>" 
                                                    data-parsley-maxlength="4"
                                                    data-parsley-maxlength-message="<?php echo (L("_reg_verification_code_maxlength_")); ?>" 
                                                    data-parsley-required-message="<?php echo (L("_reg_verification_code_")); ?>邮箱安全码" >
                                    </div>
                            </div>
                            
                            
                              
                          

                            <div class="form-group text-center row m-t-20">
                                <div class="col-12">
                                    <button data-account="<?php echo ($_GET['account']); ?>" class="btn btn-info btn-block waves-effect waves-light submit_btn" type="submit"><?php echo (L("_verify_now_")); ?></button>
                                </div>
                            </div>

                           
                        </form>
                    </div>

                </div>
            </div>
        </div> 
        
  
        <!-- jQuery  -->
        <script src="/xnqb/Public/Home/js/jquery.min.js"></script>
        <script src="/xnqb/Public/Home/js/popper.min.js"></script>
        <script src="/xnqb/Public/Home/js/bootstrap.min.js"></script>
        <script src="/xnqb/Public/Home/js/modernizr.min.js"></script>
        <script src="/xnqb/Public/Home/js/waves.js"></script>
        <script src="/xnqb/Public/Home/js/jquery.slimscroll.js"></script>
        <script src="/xnqb/Public/Home/js/jquery.nicescroll.js"></script>
        <script src="/xnqb/Public/Home/js/jquery.scrollTo.min.js"></script>
        
        <script src="/xnqb/Public/Home/layer/layer.js"></script>
        <!-- App js -->
        <script src="/xnqb/Public/Home/js/app.js"></script>
        <script type="text/javascript" src="/xnqb/Public/Home/js/parsleyjs/parsley.min.js"></script>
      <script type="text/javascript">
        $(function(){

            $('#login_form').parsley().on('form:submit', function() {
            	
            	var safe_code = $("#safe_code").val();           	
                var account = $('.submit_btn').data('account');                  
               	$.ajax({
               	    type: "POST",
               	    url: "<?php echo U('Login/authentication');?>",
               	    data: {
               	    	safe_code : safe_code,               	    	
               	    	account : account
               	    },// 要提交的表单
               	    dataType: 'json',
               	    beforeSend: function(){
       					layer_index = layer.load(1, {
       					  	shade: [0.1, '#ccc'] //0.1透明度的白色背景
       					});
       				},
               	    success: function (data, response) {
               	    	layer.close(layer_index);
               	    	if (data.flag > 0) {
               	    		window.location="<?php echo U('Login/edit_password');?>?account="+data.account+"&safe_code="+data.safe_code;
               	    	}               	    	
               	    	layer.msg(data.msg);
               	    },
               	    error: function (error) {
               	    	layer.close(layer_index);
               	    	alert('error');
               	    }
               	  });
            	  
            	 return false;
            });          
          });
       </script>
    </body>
</html>